package com.example.mybatisdemo1.service;

import com.example.mybatisdemo1.entity.Book;
import com.example.mybatisdemo1.mapper.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    @Autowired
    BookMapper bookMapper;

    public int insertBook(Book book){
        return bookMapper.insertBook(book);
    }

    public List<Book> selectAllBook(){
        return bookMapper.selectAllBook();
    }
    public int updateBook(Book book){
        return bookMapper.updateBook(book);
    }

    public int deleteBook(Book book){
        return bookMapper.deleteBook(book);
    }
}